package com.tbit.uqbike.object.pojo.vo;

import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * 站点运营统计-折线图统计vo
 *
 * @author <a href="mailto:yixingang@tbit.com.cn">yee_</a>
 * @version 1.0
 * @see <a href="#">#</a>
 * @since 2024/5/7
 */
@Data
@NoArgsConstructor
public class ParkPointMachineStatChartVO {
    /**
     * 站点id
     */
    private Integer parkPointId;
    /**
     * 站点名称
     */
    private String parkPointName;
    /**
     * 时段数据列表
     */
    private List<ParkPointMachineStatVO> dataList;

    public ParkPointMachineStatChartVO(Integer parkPointId, String parkPointName) {
        this.parkPointId = parkPointId;
        this.parkPointName = parkPointName;
    }

    public void addData(ParkPointMachineStatVO parkPointMachineStatVO) {
        if (CollUtil.isEmpty(this.dataList)) {
            this.dataList = new ArrayList<>();
        }
        this.dataList.add(parkPointMachineStatVO);
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ParkPointMachineStatVO {
        /**
         * 日期
         */
        private String dateStr;
        /**
         * 时段
         */
        private Integer timeSlot;

        /**
         * 剩余可租车辆数
         */
        private Integer availableRentCount;

    }


}
